/**
 * <copyright>
 *
 * Copyright (c) 2011 Zeligsoft (2009) Limited
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: 
 *   Zeligsoft (2009) Limited - Initial API and implementation
 *
 * </copyright>
 *
 */
package org.omg.deployment.providers;

import java.util.List;

import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
import org.eclipse.emf.eef.runtime.providers.impl.PropertiesEditingProviderImpl;
import org.omg.deployment.DeploymentPackage;
import org.omg.deployment.PlanConnectionDescription;
import org.omg.deployment.components.PlanConnectionDescriptionBasePropertiesEditionComponent;
import org.omg.deployment.components.PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent;
import org.omg.deployment.components.PlanConnectionDescriptionPropertiesEditionComponent;
import org.omg.deployment.components.PlanConnectionDescriptionRequirementsPropertiesEditionComponent;

/**
 * @author Toby McClean; Zeligsoft (2009) Limited
 * @generated
 */
public class PlanConnectionDescriptionPropertiesEditionProvider extends PropertiesEditingProviderImpl {

	/**
	 * Constructor without provider for super types.
	 */
	public PlanConnectionDescriptionPropertiesEditionProvider() {
		super();
	}

	/**
	 * Constructor with providers for super types.
	 * @param superProviders providers to use for super types.
	 */
	public PlanConnectionDescriptionPropertiesEditionProvider(List<PropertiesEditingProvider> superProviders) {
		super(superProviders);
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext)
	 * @generated
	 */
	public boolean provides(PropertiesEditingContext editingContext) {
    return (editingContext.getEObject() instanceof PlanConnectionDescription) 
          && (DeploymentPackage.eINSTANCE.getPlanConnectionDescription() == editingContext.getEObject().eClass());
  }

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String)
	 * @generated
	 */
	public boolean provides(PropertiesEditingContext editingContext, String part) {
    return (editingContext.getEObject() instanceof PlanConnectionDescription) && (PlanConnectionDescriptionBasePropertiesEditionComponent.BASE_PART.equals(part) || PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent.CONNECTIONENDS_PART.equals(part) || PlanConnectionDescriptionRequirementsPropertiesEditionComponent.REQUIREMENTS_PART.equals(part));
  }

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.Class)
	 * @generated
	 */
	@SuppressWarnings("rawtypes")
	public boolean provides(PropertiesEditingContext editingContext, java.lang.Class refinement) {
    return (editingContext.getEObject() instanceof PlanConnectionDescription) && (refinement == PlanConnectionDescriptionBasePropertiesEditionComponent.class || refinement == PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent.class || refinement == PlanConnectionDescriptionRequirementsPropertiesEditionComponent.class);
  }

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.Class)
	 * @generated
	 */
	@SuppressWarnings("rawtypes")
	public boolean provides(PropertiesEditingContext editingContext, String part, java.lang.Class refinement) {
    return (editingContext.getEObject() instanceof PlanConnectionDescription) && ((PlanConnectionDescriptionBasePropertiesEditionComponent.BASE_PART.equals(part) && refinement == PlanConnectionDescriptionBasePropertiesEditionComponent.class) || (PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent.CONNECTIONENDS_PART.equals(part) && refinement == PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent.class) || (PlanConnectionDescriptionRequirementsPropertiesEditionComponent.REQUIREMENTS_PART.equals(part) && refinement == PlanConnectionDescriptionRequirementsPropertiesEditionComponent.class));
  }

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String)
	 * @generated
	 */
	public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode) {
    if (editingContext.getEObject() instanceof PlanConnectionDescription) {
      return new PlanConnectionDescriptionPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode);
    }
    return super.getPropertiesEditingComponent(editingContext, mode);
  }

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String)
	 * @generated
	 */
	public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part) {
    if (editingContext.getEObject() instanceof PlanConnectionDescription) {
      if (PlanConnectionDescriptionBasePropertiesEditionComponent.BASE_PART.equals(part))
        return new PlanConnectionDescriptionBasePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode);
      if (PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent.CONNECTIONENDS_PART.equals(part))
        return new PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode);
      if (PlanConnectionDescriptionRequirementsPropertiesEditionComponent.REQUIREMENTS_PART.equals(part))
        return new PlanConnectionDescriptionRequirementsPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode);
    }
    return super.getPropertiesEditingComponent(editingContext, mode, part);
  }

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String, java.lang.Class)
	 * @generated
	 */
	@SuppressWarnings("rawtypes")
	public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part, java.lang.Class refinement) {
    if (editingContext.getEObject() instanceof PlanConnectionDescription) {
      if (PlanConnectionDescriptionBasePropertiesEditionComponent.BASE_PART.equals(part)
        && refinement == PlanConnectionDescriptionBasePropertiesEditionComponent.class)
        return new PlanConnectionDescriptionBasePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode);
      if (PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent.CONNECTIONENDS_PART.equals(part)
        && refinement == PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent.class)
        return new PlanConnectionDescriptionConnectionEndsPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode);
      if (PlanConnectionDescriptionRequirementsPropertiesEditionComponent.REQUIREMENTS_PART.equals(part)
        && refinement == PlanConnectionDescriptionRequirementsPropertiesEditionComponent.class)
        return new PlanConnectionDescriptionRequirementsPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode);
    }
    return super.getPropertiesEditingComponent(editingContext, mode, part, refinement);
  }

}
